<?php
/**
 * (commands)
 */
namespace App\Console\Commands\Operation;

use Illuminate\Console\Command;
use App\Logic\Operation\CrawlReviews as LCrawlReviews;
class CrawlReviews extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'operation:crawl-reviews {country}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Operation crawl-reviews';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     */
    public function handle()
    {
        $country = $this->argument('country');
        if(!$country){
            $this->error('请提供相应参数!');
        }else{
            LCrawlReviews::handle(strtoupper($country));
            $this->info('同步完成！');
        }
    }
}
